package com.chushouya.order.dto.admin.order;

import com.chushouya.common.util.OrderUtil;
import com.chushouya.order.constants.*;
import com.general.framework.core.lang.Dates;
//=====order.constants.*;
import com.chushouya.order.constants.*;
import com.chushouya.order.dto.admin.orderaddress.OrderAddressDTO;
import com.chushouya.order.dto.admin.orderextend.OrderExtendDTO;
import com.chushouya.order.dto.admin.orderproduct.OrderProductDTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@ApiModel("订单信息")
@Data
public class OrderDataDTO {
    @ApiModelProperty(value = "订单ID")
    private Long orderId;

    @ApiModelProperty("订单号")
    private String orderNo;

    /**
     * 重复单ID
     */
    @ApiModelProperty("重复单ID")
    private Long repeatOrderId;

    /**
     * 重复单类型
     */
    @ApiModelProperty("重复单类型")
    private Integer repeatOrderType;

    /**
     * 预付订单类型
     */
    @ApiModelProperty("预付订单类型")
    private Integer prepaidType;

    @ApiModelProperty("姓名")
    private String userName;

    @ApiModelProperty("手机号")
    private String userPhone;

    @ApiModelProperty("订单状态")
    private Integer orderStatus;
    @ApiModelProperty("订单文案")
    private String orderStatusText;
    @ApiModelProperty("订单回收方式")
    private Integer orderType;

    @ApiModelProperty("订单回收方式文案")
    private String orderTypeText;

    @ApiModelProperty("下单时间")
    @JsonFormat(pattern = Dates.FMT_FULL_TIME)
    private Date createTime;

    @ApiModelProperty("订单金额")
    private BigDecimal orderPrice;

    @ApiModelProperty("优惠金额")
    private BigDecimal bonusPrice;

    @ApiModelProperty("评估价")
    private BigDecimal evaluatePrice;

    @ApiModelProperty("订单回收方式")
    private Integer orderSource;

    @ApiModelProperty("订单预约开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date appointStartTime;

    @ApiModelProperty("订单预约星期")
    private String appointWeek;

    @ApiModelProperty("订单预约结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date appointEndTime;

    @ApiModelProperty("订单来源文案")
    private String orderSourceText;

    @ApiModelProperty("估价产品数据")
    private OrderProductDTO orderProduct;

    @ApiModelProperty("订单用户地址")
    private OrderAddressDTO orderAddress;

    @ApiModelProperty("订单额外信息")
    private OrderExtendDTO orderExtend;

    @ApiModelProperty("完成时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date completeTime;

    @ApiModelProperty("完成价格")
    private BigDecimal completePrice;

    @ApiModelProperty("质检价格")
    private BigDecimal qualityPrice;

    @ApiModelProperty("客服id")
    private Long kefuId;

    @ApiModelProperty("客服名称")
    private String kefuName;

    @ApiModelProperty("订单业务员Id")
    private Long clerkId;

    @ApiModelProperty("订单业务员姓名")
    private String clerkName;

    @ApiModelProperty("渠道")
    private String channel;

    @ApiModelProperty("平台编码")
    private String platform;

    @ApiModelProperty("平台")
    private String platformText;

    @ApiModelProperty("预付款")
    private BigDecimal prepaidPrice;

    @ApiModelProperty("支付状态")
    private Integer payStatus;

    @ApiModelProperty("预付款状态")
    private Integer prepaidStatus;

    @ApiModelProperty("预付款状态文案")
    private String prepaidStatusText;

    @ApiModelProperty("支付状态文案")
    private String payStatusText;

    @ApiModelProperty("合作商渠道")
    private Long partnerId;

    @ApiModelProperty("合作商渠道名称")
    private String partnerName;

    @ApiModelProperty("用户Id")
    private Long userId;

    @ApiModelProperty("支付方式")
    private Integer payType;

    @ApiModelProperty("支付方式文案")
    private String payTypeText;

    @ApiModelProperty("合作商订单号")
    private String partnerOrderNo;

    @ApiModelProperty("推广标签")
    private String promoteLabel;

    @ApiModelProperty("推广渠道名称")
    private String promoteChannel;

    @ApiModelProperty("备注")
    private String orderRemark;

    public String getUserPhone() {
        return this.userPhone;
    }

    public String getOrderStatusText() {
        return OrderStatusEnum.getDesc(this.orderStatus);
    }

    public String getOrderTypeText() {
        return OrderTypeEnum.getDesc(this.orderType);
    }

    public String getPlatformText() {
        return OrderPlatformEnum.getDesc(this.platform);
    }

    public String getOrderSourceText() {
        return OrderSourceEnum.getDesc(this.orderSource);
    }

    public String getPayStatusText() {
        return OrderPayStatusEnum.getDesc(this.payStatus);
    }

    public String getPayTypeText() {
        return OrderPayTypeEnum.getDesc(this.payType);
    }

    public String getAppointWeek() {
        return OrderUtil.time2week(this.appointStartTime);
    }
}
